<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Console extends CI_controller {

	public function __construct(){
		parent::__construct();
	}

	public function index(){
        // die();
		$data = array();
		if($this->session->userdata('user') !== false) {
			$data['user'] = json_encode($this->session->userdata('user'));
		}
		$this->load->view('zm/console',$data);
	}

    private function _ShowType4Html($arr){
        $result = array();
        foreach ($arr as $k => $v) {
            $result[] = $k.'=>'.$v;
        }
        return $result;
    }

	public function getApis() {
        // die();
		$apis = array(
            array(
                'url' => 'api_chenyang_make_photo/initCustomer',
                'title' => '晨阳水漆-初始化用户',
                'group_name' => '晨阳水漆',
                'params' => array(
                    array('name' => 'openid','value' => 'aaa'),
                    array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
                    array('name' => 'nickname','value' => '小明'),
                    array('name' => 'sex','value' => '1'),
                    array('name' => 'province','value' => '北京'),
                    array('name' => 'city','value' => '北京'),
                    array('name' => 'country','value' => 'CN'),
                    array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
                ),
                'remark' => '初始化用户数据;微信字段;返回customer;',
            ),
            array(
                'url' => 'api_chenyang_make_photo/submitPhoto',
                'title' => '晨阳水漆-提交图片',
                'group_name' => '晨阳水漆',
                'params' => array(
                    array('name' => 'img_base64','value' => '325'),
                ),
                'remark' => '<em>返回数据： img_url:图片链接</em>',
            ),
            
            array(
                'url' => 'api_chenyang_make_photo/drawnLottery',
                'title' => '晨阳水漆-抽奖',
                'group_name' => '晨阳水漆',
                'params' => array(
                ),
                'remark' => '
                返回: gift_type(奖品): 　1 => 华为P9手机, 2 => 拍立得照相机,3 => 180元红包,
                    4 => 18元红包,5 => 1.8元红包,6 => 1元红包,7 => 50元优惠券,; gift_name(奖品名称); 
                    gift_code: 优惠码 ,  money:红包金额
                ',
            ),
            array(
                'url' => 'api_chenyang_make_photo/submitAddress',
                'title' => '晨阳水漆-提交收货地址',
                'group_name' => '晨阳水漆',
                'params' => array(
                    array('name' => 'customer_name','value' => '收货姓名'),
                    array('name' => 'customer_phone','value' => '18220000000'),
                    array('name' => 'customer_address','value' => '收地址'),
                ),
                'remark' => '
                ',
            ),

            // array(
            //     'url' => 'api_lol/initCustomer',
            //     'title' => 'LOL游戏-初始化用户',
            //     'group_name' => 'LOL游戏',
            //     'params' => array(
            //         array('name' => 'openid','value' => 'aaa'),
            //         array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
            //         array('name' => 'nickname','value' => '小明'),
            //         array('name' => 'sex','value' => '1'),
            //         array('name' => 'province','value' => '北京'),
            //         array('name' => 'city','value' => '北京'),
            //         array('name' => 'country','value' => 'CN'),
            //         array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
            //     ),
            //     'remark' => '初始化用户数据;微信字段;返回customer;',
            // ),
            // array(
            //     'url' => 'api_lol/apply',
            //     'title' => 'LOL游戏-报名',
            //     'group_name' => 'LOL游戏',
            //     'params' => array(
            //         array('name' => 'customer_apply_score','value' => '80'),
            //         array('name' => 'customer_apply_info','value' => '答案'),
            //         array('name' => 'customer_name','value' => '小明'),
            //         array('name' => 'customer_phone','value' => '18612345678'),
            //     ),
            //     'remark' => 'customer_apply_score:分数， customer_apply_info:答案; 返回customer;',
            // ),

            // array(
            //     'url' => 'api_hb_oil_subsidy/initCustomer',
            //     'title' => '戳戳乐-初始化用户',
            //     'group_name' => '戳戳乐',
            //     'params' => array(
            //         array('name' => 'openid','value' => 'aaa'),
            //         array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
            //         array('name' => 'nickname','value' => '小明'),
            //         array('name' => 'sex','value' => '1'),
            //         array('name' => 'province','value' => '北京'),
            //         array('name' => 'city','value' => '北京'),
            //         array('name' => 'country','value' => 'CN'),
            //         array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
            //     ),
            //     'remark' => '初始化用户数据;微信字段;返回customer;city_data:城市数据',
            // ),
            // array(
            //     'url' => 'api_hb_oil_subsidy/startGame',
            //     'title' => '戳戳乐-开始游戏',
            //     'group_name' => '戳戳乐',
            //     'params' => array(
            //         array('name' => 'city_id','value' => '1'),
            //     ),
            //     'remark' => '<em>code:结束游戏，提交</em>',
            // ),
            // array(
            //     'url' => 'api_hb_oil_subsidy/endGame',
            //     'title' => '戳戳乐-结束游戏',
            //     'group_name' => '戳戳乐',
            //     'params' => array(
            //         array('name' => 'city_id','value' => '1'),
            //         array('name' => 'click_times','value' => '100'),
            //         array('name' => 'code','value' => ''),
            //     ),
            //     'remark' => 'gift_money:红包金额',
            // ),


            // array(
            //     'url' => 'api_hb_game/initCustomer',
            //     'title' => '北京现代-初始化用户',
            //     'group_name' => '北京现代',
            //     'params' => array(
            //         array('name' => 'openid','value' => 'aaa'),
            //         array('name' => 'openid_md5','value' => 'e1d8f1c4ce60cefd8a1ccbafddbbb0af'),
            //         array('name' => 'nickname','value' => '小明'),
            //         array('name' => 'sex','value' => '1'),
            //         array('name' => 'province','value' => '北京'),
            //         array('name' => 'city','value' => '北京'),
            //         array('name' => 'country','value' => 'CN'),
            //         array('name' => 'headimgurl','value' => 'http://www.relonline.cn/resource/relonline$1/logo.jpg'),
            //     ),
            //     'remark' => '初始化用户数据;微信字段;返回customer;',
            // ),
            // array(
            //     'url' => 'api_hb_game/submitRunResult',
            //     'title' => '北京现代-提交跑的距离',
            //     'group_name' => '北京现代',
            //     'params' => array(
            //         array('name' => 'distance','value' => '325'),
            //     ),
            //     'remark' => '<em>返回数据： salt: 安全码，需要抽奖的接口传回; closer_percent: 比例</em>',
            // ),
            
            // array(
            //     'url' => 'api_hb_game/drawnLottery',
            //     'title' => '北京现代-抽奖',
            //     'group_name' => '北京现代',
            //     'params' => array(
            //         array('name' => 'salt','value' => ''),
            //     ),
            //     'remark' => '
            //     返回: gift_type(奖品): 　1 =>  精美领动汽车模型, 2 => 胡歌帅气写真集, 3 => 胡歌领动cp画册, 4 => 专为“看片族”定制的VR眼镜; gift_name(奖品名称); 
            //     ',
            // ),
            // array(
            //     'url' => 'api_hb_game/submitAddress',
            //     'title' => '北京现代-提交收货地址',
            //     'group_name' => '北京现代',
            //     'params' => array(
            //         array('name' => 'customer_name','value' => '收货姓名'),
            //         array('name' => 'customer_phone','value' => '18220000000'),
            //         array('name' => 'customer_address','value' => '收地址'),
            //     ),
            //     'remark' => '
            //     ',
            // ),
            // array(
            //     'url' => 'api_hb_game/getLotteryCustomerList',
            //     'title' => '北京现代-得到中奖用户',
            //     'group_name' => '北京现代',
            //     'params' => array(
            //     ),
            //     'remark' => '
            //     ',
            // ),
		);

		$this->response->setSuccess();
		$this->response->setItems($apis);
		$this->response->responseExit();
	}
}
/* End of file console.php */
/* Location: ./application/controllers/console.php */